$(function(){
	showAllComment();
})
function showAllComment(){
	var proId=getParam("proId");
	$.ajax({
		url:"comment/front/showList.action",
		data:{"proId":proId},
		type:"post",
		async:true,
		cache:false,
		success:function(obj){
			var str="";
			var comment=obj.comment;
			for(var i=0;i<comment.length;i++){
			str="<div class='comment'><div class='mbMesBox'><div class='num'>"+(i+1)+"</div><div class='mbRemark'><img alt='' class='mbRemark' src="+comment[i].mbPhoto+"></div><div class='mbMessage'><ul class='nameAndLv'><li>买家名称：<span class='name'>"+comment[i].mbName+"</span></li><li>买家等级：";
			if(comment[i].levels>0&&comment[i].levels<8){
				for(var j=0;j<comment[i].levels;j++){
					if(j>=4){
						break;
					}
					str+="<img style='width:19px;height:24px;' src='res/images/level_one.png'>";
					
				}
			}else if(comment[i].levels>=8&&comment[i].levels<50){
				var k=8;
				while(k<=comment[i].levels&&k<=32){
					k=k+8;
					str+="<img style='width:19px;height:24px;' src='res/images/level_tow.png'>";
					
				}
			}else if(comment[i].levels>=50){
				var k=50;
				while(k<=comment[i].levels&&k<=400){
					k=k*2;
					str+="<img style='width:19px;height:24px;' src='res/images/level_three.png'>";
				}
			}
			str+="</li></ul></div></div><div class='fgx'></div><div class='remark'>买家评语：<span class='mes'>"+comment[i].mbDesc+"</span></div><div class='photo'>买家实物拍照描述：<br>"
			imgarr=comment[i].img.split(",");
			for(var j=0;j<2;j++){
				str+="<div class='mbPhoto'><img class='pto' alt='' src="+imgarr[j]+"></div>"
			 }
			str+="<div class='sl'><p>.....</p></div></div><div class='jump'><a class='back' href=pages/front/appraise.html?proId="+getParam("proId")+"&shaId="+comment[i].shaId+">(点击查看详细描述)</a></div></div>"
			$("#comment").append(str);
			}
		
		},
		error(){
			alert("失败")
		}
	})
}